//
// Created by zhouyi on 2019/10/21.
//

#include "include/LearnFileManager.h"
#include <string.h>
#include <time.h>

FILE *openFile() {
    const char *pathFile = "/Users/zkingcobra/Projects/CLionProjects/xiangxueVip/text/test.txt";
    FILE *pFile = fopen(pathFile, "w");
    if (pFile == 0) {
        printf("open file fail \n");
        return NULL;
    }
    return pFile;
}


void writeToFile(FILE *pFile) {
    fputs("测试fputs方法的输入\n", pFile);

    char buffer[] = "测试fwrite方法的输入~\n";
    fwrite(&buffer, sizeof(char), strlen(buffer), pFile);

    fputs("====================================\n", pFile);
    fputs("测试fputs方法的输入2\n", pFile);

}


void readFromFile(FILE *pFile) {

}


void closeFile(FILE *pFile) {
    fclose(pFile);
};


